﻿using System;
namespace xiaohongshu
{
    class Sol1
    {
        public int FindMax2(int[] arr)
        {
            int n = arr.Length;
            int maxLength = 0;

            for (int i = 1; i < n - 1; i++)
            {
                int left = i - 1;
                int right = i + 1;
                int leftLength = 0;
                int rightLength = 0;
                int currentLength = 0;

                // 向左扩展
                while (left >= 0)
                {
                    if (arr[left] < arr[left + 1])
                    {
                        leftLength++;
                        left--;
                    }
                    else
                    {
                        break;
                    }

                }

                // 向右扩展
                while (right < n)
                {
                    if (arr[right] > arr[right - 1])
                    {
                        rightLength++;
                        right--;
                    }
                    else
                    {
                        break;
                    }
                }
                if (leftLength > 0 && rightLength > 0)
                {

                    currentLength = leftLength + rightLength + 1;
                }

                maxLength = Math.Max(maxLength, currentLength);
            }

            return maxLength;
        }


        public int FindMax(int[] nums)
        {
            int n = nums.Length; 
            int[] leftLen= new int[n];//左边递增序列长度
            int[] rightLen= new int[n];//右边递增序列长度
            leftLen[0] = 0;

            for (int i = 1; i < n; i++)
            {
                if (nums[i] > nums[i - 1])
                {
                    leftLen[i] = leftLen[i - 1]+1;
                }
                else
                {
                    leftLen[i]=0;
                }
                
            }

            rightLen[n-1] = 0;

            for (int i = n-2; i >=0; i--)
            {
                if (nums[i] > nums[i + 1])
                {
                    rightLen[i] = rightLen[i + 1]+1;
                }
                else
                {
                    rightLen[i] = 0;
                }

            }

          
            int maxLen = 0;
            for (int i = 0; i < n; i++)
            {
                //int curLen = leftLen[i]+ rightLen[i]-1;//不能直接相加，因为必须两边都是递增，单边递增不是山峰
                if (leftLen[i]!=0&& rightLen[i] != 0)
                {
                    int curLen = leftLen[i] + rightLen[i] + 1;
                    maxLen = Math.Max(maxLen, curLen);

                }

               
            }

            return maxLen;


        }



        }

    class Program1
    {
        public static void Main1(string[] args)
        {

            string line;


            while ((line = Console.ReadLine()) != null)
            {
                string[] tokens = line.Split();

                int n = int.Parse(tokens[0]);
                line = Console.ReadLine();
                tokens = line.Split();

                int[] nums = new int[n];
                for (int i = 0; i < n; i++)
                {
                    nums[i] = int.Parse(tokens[i]);
                }

                Sol1 sol = new Sol1();
                int res = sol.FindMax(nums);
                Console.WriteLine(res);
            }

        }

    }
}
